< previous page page_618 next page >

Page 618
Using the Characters Object
The Agent control can support one or more characters using the Characters object. To access a character, use the Load method to load the character's data (.ACS file) into the Characters collection and specify that the item in the collection uses the methods and properties supported for that character. The Characters object supports the following methods:
Load loads a character into the Characters collection.
Unload unloads the character data for the specified character ID.
Character isn't required for Visual Basic programs because Visual Basic supports collections.
The Characters collection also has methods that enable the character to appear, move to a particular location onscreen, gesture at something on the form, talk to users, and disappear:
GestureAt plays the gesturing animation for the character at the specified location.
Hide hides the specified character.
Move To moves the specified character to the specified location.
Play plays the specified animation for the specified character.
Show makes the specified character visible and plays its Showing animation.
Speak, by using the character voice, speaks the specified text.
Stop stops the animation for the specified character.
Wait has the specified character wait for the specified request to complete before continuing.
When you load a character, you assign it an ID that you'll use to reference the character from within the application. In your new application, place the following code into the Form_Load event to load the character data into the application:
Agent1.Characters.Load Genie,_
   c:\program files\microsoft agent\characters\genie.acs
Note
The examples in today's lesson use the GENIE.ACS character file, but you can use either of the other two characters instead.

 
< previous page page_618 next page >

If you like this book, buy it!